package com.sikaryofficial.backend.constant;

import lombok.Getter;

/**
 * @author : wuweihong
 * @desc :
 * @date : 2024-12-06
 */

@Getter
public enum GuideTaskEnum {

	// 枚举编码：share_friend,home_page_post,leave_comments,go_to_ske, 根据枚举编码生成枚举类，包含枚举常亮，私有构造方法，根据code获取枚举值
	SHARE_FRIEND("share_friend", "分享好友", 1),
	HOME_PAGE_POST("home_page_post", "首页发帖", 1),
	LEAVE_COMMENTS("leave_comments", "评论", 1),
	GO_TO_SKE("go_to_ske", "去 ske", 1);

	private final String taskCode;

	private final String taskDesc;

	private final Integer taskNum;

	/***
	 * 私有构造方法，根据code获取枚举值
	 */
	GuideTaskEnum(String taskCode, String taskDesc, Integer taskNum) {
		this.taskCode = taskCode;
		this.taskDesc = taskDesc;
		this.taskNum = taskNum;
	}

	/**
	 * 根据code获取枚举值
	 */
	public static GuideTaskEnum getByCode(String code) {
		for (GuideTaskEnum guideTaskEnum : GuideTaskEnum.values()) {
			if (guideTaskEnum.getTaskCode().equals(code)) {
				return guideTaskEnum;
			}
		}
		return null;
	}

}
